package apps.generate.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

import core.tool.log.log4j.EasyLogger;

public class JdbcDaoSupport<T> {
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	
	protected List<T> query(String sql,Object[] args,RowMapper<T> rowMapper) {
		EasyLogger.debug("查询:"+sql);
		List<T> list=jdbcTemplate.query(sql, args, rowMapper);
		EasyLogger.debug("返回结果:"+list.toString());
		return list;
	}
	
	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	

}
